package com.isoft.dao.tabledao;
import com.isoft.entity.tableentity.base_apue.Apot;
import com.isoft.entity.tableentity.base_apue.BaseApueMeta;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;

@Mapper
public interface BaseApueDao {
    @Insert("insert into TEAM04.COMMON_META( create_time, sndr, rcvr, seqn, ddtm, type, styp) " +
            "values( #{create_time}, #{meta.sndr}, #{meta.rcvr}, #{meta.seqn}," +
            " #{ddtm}, #{meta.type}, #{meta.styp})")
    public int insertMeta(@Param("create_time") Timestamp create_time,
                          @Param("ddtm") Timestamp ddtm, @Param("meta") BaseApueMeta baseApueMeta);
    @Insert("insert into TEAM04.BASE_APUE(meta_id,create_time,code,frcd,apat,cnnm,ennm,aiso,apsn) " +
            "values(#{meta_id},#{create_time},#{apot.code},#{apot.frcd},#{apot.apat},#{apot.cnnm}," +
            "#{apot.ennm},#{apot.aiso},#{apot.apsn})")
    public int insertApot(@Param("meta_id") int meta_id, @Param("create_time")
                            Timestamp create_time, @Param("apot")Apot apot);
}
